package com.ruoyi.drone_certification.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.drone_certification.mapper.DroneCertificationMapper;
import com.ruoyi.drone_certification.domain.DroneCertification;
import com.ruoyi.drone_certification.service.IDroneCertificationService;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 无人机认证Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-20
 */
@Service
public class DroneCertificationServiceImpl implements IDroneCertificationService 
{
    @Autowired
    private DroneCertificationMapper droneCertificationMapper;

    /**
     * 查询无人机认证
     * 
     * @param id 无人机认证主键
     * @return 无人机认证
     */
    @Override
    public DroneCertification selectDroneCertificationById(Long id)
    {
        return droneCertificationMapper.selectDroneCertificationById(id);
    }

    /**
     * 查询无人机认证列表
     * 
     * @param droneCertification 无人机认证
     * @return 无人机认证
     */
    @Override
    public List<DroneCertification> selectDroneCertificationList(DroneCertification droneCertification)
    {
        System.out.println(droneCertification);
        return droneCertificationMapper.selectDroneCertificationList(droneCertification);
    }

    @Override
    public List<DroneCertification> selectDroneCertificationList(String maniName) {
        System.out.println("///////service");
        System.out.println(maniName);
        List<DroneCertification> droneCertifications = droneCertificationMapper.selectDroneCertificationListByManiName(maniName);
        return droneCertifications;
    }

    /**
     * 新增无人机认证
     * 
     * @param droneCertification 无人机认证
     * @return 结果
     */
    @Override
    public int insertDroneCertification(DroneCertification droneCertification)
    {
        droneCertification.setCreateTime(DateUtils.getNowDate());
        return droneCertificationMapper.insertDroneCertification(droneCertification);
    }

    /**
     * 修改无人机认证
     * 
     * @param droneCertification 无人机认证
     * @return 结果
     */
    @Override
    public int updateDroneCertification(DroneCertification droneCertification)
    {
        droneCertification.setUpdateTime(DateUtils.getNowDate());
        return droneCertificationMapper.updateDroneCertification(droneCertification);
    }

    /**
     * 批量删除无人机认证
     * 
     * @param ids 需要删除的无人机认证主键
     * @return 结果
     */
    @Override
    public int deleteDroneCertificationByIds(Long[] ids)
    {
        return droneCertificationMapper.deleteDroneCertificationByIds(ids);
    }

    /**
     * 删除无人机认证信息
     * 
     * @param id 无人机认证主键
     * @return 结果
     */
    @Override
    public int deleteDroneCertificationById(Long id)
    {
        return droneCertificationMapper.deleteDroneCertificationById(id);
    }
}
